CREATE TABLE jms_dwd.dwd_waybill_customer_complaint_detail_dt
(
    data_time              date COMMENT "数据时间",
    work_type              varchar(200) COMMENT "工单类型",
    accept_time            varchar(200) COMMENT "受理时间",
    waybill_no             varchar(200) COMMENT "运单号",
    first_type_code        varchar(200) COMMENT "一级问题类型编码",
    first_type_name        varchar(2048) COMMENT "一级问题类型名称",
    second_type_code       varchar(200) COMMENT "二级问题类型编码",
    second_type_name       varchar(2048) COMMENT "二级问题类型名称",
    create_time            varchar(200) COMMENT "创建时间",
    trans_offices          varchar(200) COMMENT "转办局",
    deliver_type           varchar(200) COMMENT "投递类型",
    accept_network_code    varchar(200) COMMENT "受理网点编码",
    accept_network_name    varchar(200) COMMENT "受理网点名称",
    accept_network_type    bigint(20) COMMENT "网点标识,1网点,2转运中心,3集散点,4其它",
    accept_proxy_code      varchar(200) COMMENT "受理网点所属代理区编码",
    accept_proxy_name      varchar(200) COMMENT "受理网点所属代理区名称",
    transfer_network_code  varchar(200) COMMENT "转单责任网点编码",
    transfer_network_name  varchar(200) COMMENT "转单责任网点名称",
    transfer_network_types bigint(20) COMMENT "转单责任网点类型",
    transfer_network_type  bigint(20) COMMENT "转单责任网点类型",
    duty_network_code      varchar(200) COMMENT "责任网点编码",
    duty_network_name      varchar(200) COMMENT "责任网点名称",
    duty_network_type      bigint(20) COMMENT "责任网点类型ID",
    duty_proxy_code        varchar(200) COMMENT "责任网点所属代理区编码",
    duty_proxy_name        varchar(200) COMMENT "责任网点所属代理区名称",
    work_order_reason_step varchar(200) COMMENT "引发诉问题的环节",
    is_delete              bigint(20) COMMENT "是否已删除 1:已删除，2：未删除，0：不存在",
    work_order_no          varchar(64) COMMENT "工单编号",
    delivery_code          varchar(64) COMMENT "派件员编码",
    delivery_name          varchar(64) COMMENT "派件员名称",
    tail_code              varchar(64) COMMENT "区域编码",
    tail_name              varchar(64) COMMENT "区域名称",
    problem_desc           varchar(2048) COMMENT "问题描述",
    work_order_channel     int(11) COMMENT "渠道来源(1.PDD，2.紫金山)",
    express_cabinet        varchar(64) COMMENT "快递柜",
    incoming_time          datetime COMMENT "入库时间",
    trans_time             datetime COMMENT "转办时间",
    his_delete             tinyint(4) COMMENT "是否历史剔除",
    work_order_source_id   varchar(100) COMMENT "工单创建来源 0：平台 1：消费者 2：商家",
    remarks                varchar(100) COMMENT "投诉内容“未收到货”或反馈没收到货",
    create_day             varchar(100) COMMENT "日期-创建时间截取年月日",
    order_source_code      varchar(100) COMMENT "工单来源编码",
    order_source_name      varchar(100) COMMENT "工单来源名称",
    duty_type              varchar(100) COMMENT "责任类型",
    provider_id            varchar(100) COMMENT "责任网点所属省份id",
    provider_desc          varchar(100) COMMENT "责任网点所属省份名称",
    city_id                varchar(100) COMMENT "责任网点所属城市id",
    city_desc              varchar(100) COMMENT "责任网点所属城市name",
    district_code          varchar(100) COMMENT "片区code",
    district_desc          varchar(100) COMMENT "片区name",
    district_id            varchar(100) COMMENT "片区id",
    record_group           varchar(65533) COMMENT "录单组别 1:电话组 2:在线组",
    send_back_code         varchar(65533) COMMENT "客诉退回标识:1是2否",
    reback_transfer_falg   varchar(65533) COMMENT "退转件中是否退回:1是0否"
) ENGINE = OLAP DUPLICATE KEY(data_time, work_type, accept_time) COMMENT '客诉量明细'
    PARTITION BY RANGE(data_time)
(START ('2022-06-28') END ('2022-12-30') EVERY (INTERVAL 1 day)
)
DISTRIBUTED BY HASH(waybill_no) BUCKETS 5
PROPERTIES (
'replication_num' = '3',
'dynamic_partition.enable' = 'true',
'dynamic_partition.time_unit' = 'DAY',
'dynamic_partition.time_zone' = 'Asia/Shanghai',
'dynamic_partition.start' = '-180',
'dynamic_partition.end' = '2',
'dynamic_partition.prefix' = 'p',
'dynamic_partition.buckets' = '5',
'in_memory' = 'false',
'storage_format' = 'V2'
);
alter table jms_dwd.dwd_waybill_customer_complaint_detail_dt
    add column (
        record_group varchar(100) comment '录单组别 1:电话组 2:在线组',
        send_back_code varchar(100) comment '客诉退回标识:1是2否',
        reback_transfer_falg varchar(100) comment '退转件中是否退回:1是0否'
        ) ;


